function count = countNonZeroAC2(q)
    % q should be the DCT coeffients in 8x8 blocks.
    [M,N] = size(q);
    q(1:8:M,1:8:N) = 0; % set all DC = 0
    count = nnz(q);
end

